import request from '@/utils/request'

export default {
  planList(params) {
    return request({
      url: '/v1/plansList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/plans/${id}`,
      method: 'get'
    })
  },
  update(data) {
    return request({
      url: '/v1/plansUpdate',
      method: 'post',
      data
    })
  },
  create(data) {
    return request({
      url: '/v1/plansAdd',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/plansDel/${id}`,
      method: 'get'
    })
  },
  memberAppend(data) {
    return request({
      url: '/v1/plansMemberAppend',
      method: 'post',
      data
    })
  },
  memberRemove(id) {
    return request({
      url: `/v1/plansMemberRemove/${id}`,
      method: 'get'
    })
  },
  partsAppend(data) {
    return request({
      url: '/v1/plansPartsAppend',
      method: 'post',
      data
    })
  },
  partsRemove(id) {
    return request({
      url: `/v1/plansPartsRemove/${id}`,
      method: 'get'
    })
  },
  partsEdit(data) {
    return request({
      url: '/v1/plansPartsEdit',
      method: 'post',
      data
    })
  },
  taskAppend(data) {
    return request({
      url: '/v1/plansTaskAppend',
      method: 'post',
      data
    })
  },
  excel(data) {
    return request({
      url: '/v1/planImport',
      method: 'post',
      data
    })
  },
  taskRemove(id) {
    return request({
      url: `/v1/plansTaskRemove/${id}`,
      method: 'get'
    })
  },
  taskEdit(data) {
    return request({
      url: '/v1/plansTaskEdit',
      method: 'post',
      data
    })
  }
}
